<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>职员修改</title>
    <link rel="stylesheet" href="../../assets/libs/layui/css/layui.css">

</head>
<body>
<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">Id</label>
        <div class="layui-input-block">
            <input type="text" id="eId" name="EId" lay-verify="title" autocomplete="off" placeholder="请输入编号"
                   class="layui-input" readonly>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">职员姓名</label>
        <div class="layui-input-block">
            <input type="text" id="eName" name="EName" lay-verify="title" autocomplete="off" placeholder="请输入姓名" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-block">
            <input type="radio" id="eGender1" name="EGender" value="男" title="男" checked>
            <input type="radio" id="eGender2" name="EGender" value="女" title="女">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">年龄</label>
        <div class="layui-input-block">
            <input type="text" id="eAge" name="EAge" lay-verify="title" autocomplete="off" placeholder="请输入年龄" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-block">
                <input type="text"  name="EBirthday" id="date1" autocomplete="off" class="layui-input">
            </div></div></div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">职位</label>
            <div class="layui-input-inline">
                <input type="text" id="eJob" name="EJob" lay-verify="job" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">工作地点</label>
        <div class="layui-input-block">
            <input type="text" id="eLocation" name="ELocation" lay-verify="title" autocomplete="off" placeholder="请输入工作地址" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>
</body>
<script src="../../assets/libs/layui/layui.js"></script>
<script src="../../assets/js/my.js"></script>
<script>
    layui.use(['form','layer','layedit','jquery','laydate'],function () {
        var form=layui.form,
            layer=layui.layer,
            // layedit=layui.layedit,
            laydate=layui.laydate,
            $=layui.jquery;

        laydate.render({
            elem:'#date1'
        });

        form.on('submit(demo1)',function (data) {
            layer.alert(JSON.stringify(data.field),{
                title:'最终提交消息'
            });
            $.get(host+'/employeeservlet/update',data.field,function (r) {
                if(r.code==0){
                    alert(r)
                    layer.msg("修改成功",{icon:1})

                }else{
                    layer.msg("修改失败",{icon:2})
                }
            });
        })

    })
</script>
</html>